package com.pricl.frame.core.mybatis;

public class DataSourceSelectHolder {

	/**
	 * 
	 */
	private static final ThreadLocal<Boolean> contextHolder = new ThreadLocal<Boolean>() {

		@Override
		protected Boolean initialValue() {
			return false;
		}

	};
	
	public static void setMaster() {
		contextHolder.set(false);
	}

	public static void setSlave() {
		contextHolder.set(true);
	}

	public static Boolean isSlave() {
		return contextHolder.get();
	}

	public static void reset() {
		contextHolder.set(false);
	}
}
